import random
import functools
import help

allName=['凌星雪','成夜希','叶文珊','成轩御','絮韵曦','晨韵妍']
allClass=[1909,1909,1909,1909,1909,1909]
stuNum=len(allName)

class student:
    def __init__(self,name,c):
        self.name=name
        self.c=c

    def toStr(self):
        self.c=str(self.c)
        return self.num+','+self.c+','+self.name+','+self.block+','+self.roomNum

allStudent=[]
for i in range(stuNum):
    allStudent.append(student(allName[i],allClass[i]))

# 生成学号
for s in allStudent:
    num=random.randint(100000,199999)
    num=str(num)
    s.num=str(s.c)+num[1:]

allStudent=sorted(allStudent,key=functools.cmp_to_key(help.cmp))

block=['北苑一栋','北苑二栋','玫瑰园','北苑十一栋','北苑十二栋','下安桃山公寓']

i=0
while i<=stuNum-1+4:
    roomNum = str(random.randint(100, 999))
    blockNum = random.randint(0,5)
    for j in range(i,min(i+4,stuNum)):
        s=allStudent[j]
        s.block=block[blockNum]
        s.roomNum=roomNum
    i+=4

for s in allStudent:
    print(s.toStr())